-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to Wagtail 6.2 #8522
Upgrade to Wagtail 6.2 #8522
Conversation
b031f89
to
430c0a7
Compare
430c0a7
to
4c242e6
Compare
dc6d70b
to
44b0ce4
Compare
db3d1e1
to
848c2b8
Compare
cfgov/cfgov/settings/base.py
Outdated
"CLIENT_TOKEN": os.environ.get("AKAMAI_CLIENT_TOKEN"), | ||
"CLIENT_SECRET": os.environ.get("AKAMAI_CLIENT_SECRET"), | ||
"ACCESS_TOKEN": os.environ.get("AKAMAI_ACCESS_TOKEN"), | ||
"HOSTNAMES": ["www.consumerfinance.gov"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a problem for beta.consumerfinance.gov, which has its own Akamai configuration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved this to a variable in base.py for both Akamai and Cloudfront. Will have a corresponding Ansible PR presently.
24c6379
to
c45079c
Compare
`WAGTAIL_USER_CREATION_FORM` and `WAGTAIL_USER_EDIT_FORM` are deprecated in favor of subclassing Wagtail's `UserViewSet` class and providing a custom `WagtailUserAppConfig` class that overrides that of `wagtail.users`. See https://docs.wagtail.org/en/latest/releases/6.2.html#deprecation-of-wagtail-user-edit-form-wagtail-user-creation-form-and-wagtail-user-custom-fields-settings This is... not my favorite bit of Django code, and feels a little anti-idiomatic. Effectively what happens here is that the `LoginUsersAppConfig` that we define (alongside `LoginConfig` — it doesn't work when combined) both allows us to override `user_viewset` and provide our own ***AND*** replaces that of `wagtail.users`, so that `login.apps.LoginUsersAppConfig` masquerades as `wagtail.users` for the sake of Django's app registration. But this is the direction Wagtail has gone for user and group viewset overrides 🤷🏻♂️.
A dict of distribution ids for CloudFront is deprecated in Wagtail 6.2. We were only using a dict for a single distribution ID, so this isn't terribly impactful but does require us to change our configuration format slightly. See https://docs.wagtail.org/en/latest/releases/6.2.html#specifying-a-dict-of-distribution-ids-for-cloudfront-cache-invalidation-is-deprecated fixy cloud
This change updates our CDN tools, AkamaiBackend, etc, for the Wagtail 6.2 changes in frontend caching. It also moves all our CDN tools and frontend caching to a separate package outside of v1 to isolate the functionality.
Wagtail 6.2 changes reports to use the new universal listing templates. This necessitates several changes, outlined in the release notes here: https://docs.wagtail.org/en/latest/releases/6.2.html#changes-to-report-views-with-the-new-universal-listings-ui This change makes all of these required changes to our existing reports and report templates. In the process, I have also removed the "no-XSLX" base template and option; all our reports are now available as both CSV and XSLX. fix http
07f3ebe
to
c52572f
Compare
This change fixes the `invalidate_page_cache` management command after the changes for Wagtail 6.2 in #8522.
This PR upgrades us to Wagtail 6.2.
There are a few changes worth noting:
Custom
UserViewSet
in place of user creation, edit form settingsWAGTAIL_USER_CREATION_FORM
andWAGTAIL_USER_EDIT_FORM
are deprecated in favor of subclassing Wagtail'sUserViewSet
class and providing a customWagtailUserAppConfig
class that overrides that ofwagtail.users
. See https://docs.wagtail.org/en/latest/releases/6.2.html#deprecation-of-wagtail-user-edit-form-wagtail-user-creation-form-and-wagtail-user-custom-fields-settingsThis is... not my favorite bit of Django code, and feels a little anti-idiomatic. Effectively what happens here is that the
LoginUsersAppConfig
that we define (alongsideLoginConfig
— it doesn't work when combined) both allows us to overrideuser_viewset
and provide our own AND replaces that ofwagtail.users
, so thatlogin.apps.LoginUsersAppConfig
masquerades aswagtail.users
for the sake of Django's app registration. But this is the direction Wagtail has gone for user and group viewset overrides 🤷🏻♂️.Updated reports
Wagtail 6.2 changes reports to use the new universal listing templates. This necessitates several changes, outlined in the release notes here: https://docs.wagtail.org/en/latest/releases/6.2.html#changes-to-report-views-with-the-new-universal-listings-ui
This change makes all of these required changes to our existing reports and report templates.
In the process, I have also removed the "no-XSLX" base template and option; all our reports are now available as both CSV and XSLX.
Reorganized CDN tools code
Wagtail 6.2 makes minor updates to the frontend cache API beyond the documented CloudFront changes. While updating our caching code, I've moved it out of
v1
and isolated it in its own Django app,cdntools
. This code is mostly as it was, aside from adding aCACHED_URLS
parameter to ourMockCacheBackend
.Finally, we still have a RemovedInWagtail70Warning: The usage of WidgetWithScript hook is deprecated. Use external scripts instead. warning that will be fixed by wagtail/wagtail-autocomplete#180 when (if?) it gets merged (hopefully before Wagtail 7.0 🤞🏻).
Checklist